bpf: Avoid ABI change in 4.9.77
authorYves-Alexis Perez <corsac@debian.org>
Sat, 20 Jan 2018 13:52:32 +0000 (14:52 +0100)
committerYves-Alexis Perez <corsac@debian.org>
Fri, 9 Feb 2018 12:58:52 +0000 (12:58 +0000)
commit87a2d201db06099181e2a81b285ab8e268b2e407
treebf545eb2712f5f17f9a06685893ba49a4a3829b1
parent40930c5acc213a9541806861342eb217ba0e9312
bpf: Avoid ABI change in 4.9.77

Commit a9bfac14cde2 "bpf: prevent out-of-bounds speculation" added one
member each to struct bpf_map and struct bpf_array (which is
effectively a sub-type of bpf_map).  Changing the size of struct
bpf_array is an ABI change, since the array contents immediately
follows the structure.  However, bpf_map::work is not used (or even
initialised) until after the map's refcount drops to zero.  We can
therefore move the new members into a union with it.

Based on the patch against 4.14.14 by Ben Hutchings <ben@decadent.org.uk>

Gbp-Pq: Topic debian
Gbp-Pq: Name bpf-avoid-abi-change-in-4.9.77.patch
include/linux/bpf.h
kernel/bpf/arraymap.c
kernel/bpf/verifier.c